import Vue from 'vue';
import App from './App.vue';
import 'muse-ui/dist/muse-ui.css';
import MuseUI from 'muse-ui';
import store from './store';
import VueToast from 'vue2-toast';
import 'vue2-toast/lib/toast.css';
import theme from 'muse-ui/lib/theme';
import router from './router';
import api from '@/api';
import filters from '@/filters'; // 过滤器
import components from '@/components';

Vue.config.productionTip = false;

theme.add('custom', {
  primary: '#46b2f1',
  secondary: '#ff4081',
  success: '#4caf50',
  warning: '#fdd835',
  info: '#46b2f1',
  error: '#f44336',
  track: '#bdbdbd',
  text: {
    primary: 'rgba(0, 0, 0, 0.87)',
    secondary: 'gba(0, 0, 0, 0.54)',
    alternate: '#fff',
    disabled: 'rgba(0, 0, 0, 0.38)',
    hint: 'rgba(0, 0, 0, 0.38)' // 提示文字颜色
  },
  divider: 'rgba(0, 0, 0, 0.12)',
  background: {
    paper: '#fff',
    chip: '#e0e0e0',
    default: '#fafafa'
  }
});

theme.use('custom');
Object.keys(filters).forEach(k => Vue.filter(k, filters[k]));
Object.keys(components).forEach(key => {
  Vue.component(key, components[key]);
});
Vue.use(VueToast);
Vue.use(MuseUI);

Vue.prototype.$api = api;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app');
